//
//  SelectPresentVC.m
//  CenturyCity
//
//  Created by beisheng03 on 2018/1/2.
//  Copyright © 2018年 beisheng. All rights reserved.
//

#import "SelectPresentVC.h"

@interface SelectPresentVC()

/* */
@property (nonatomic, strong) UIButton *btn;

@end

@implementation SelectPresentVC

- (UIButton *)btn{
    
    if (_btn == nil) {
        _btn = [UIButton buttonWithType:UIButtonTypeCustom];
        _btn.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.3];
        [_btn addTarget:self action:@selector(bgBtnDidClick) forControlEvents:UIControlEventTouchUpInside];
    }
    
    
    return  _btn;
}

- (void)containerViewWillLayoutSubviews{
    [super containerViewWillLayoutSubviews];
    
    self.containerView.backgroundColor = [UIColor clearColor];
    NSLog(@"%ld-------",self.model.language.count);
    self.presentedView.frame = CGRectMake(([UIScreen mainScreen].bounds.size.width - 280) * 0.5, (KScreenH - (self.model.language.count * 50) - 88) * 0.5, 280, self.model.language.count * 50 + 88);
    
    self.presentedView.layer.masksToBounds = YES;
    self.presentedView.layer.cornerRadius = 10;
    
}


- (void)presentationTransitionWillBegin{
    [super presentationTransitionWillBegin];
    
    [self.containerView addSubview:self.btn];
    
    self.btn.frame = self.containerView.bounds;
    
    
}


- (void)bgBtnDidClick{
    
    [self.presentedViewController dismissViewControllerAnimated:YES completion:nil];
    
}
@end
